package com.hhcn.sort;

import com.hhcn.sort.model.Person;
import org.apache.hadoop.mapreduce.Partitioner;

import javax.xml.soap.Text;

/**
 * Created by Administrator on 2018/5/24.
 */
public class PersonNamePartitioner extends Partitioner<Person, Text> {

    public int getPartition(Person key, Text value, int reduceNumber) {
        return (key.getLastName().hashCode() * 127) % reduceNumber;
    }

}
